/*
 * @Author: ZephyrGao
 * @Date: 2023-11-01 17:20:45
 * @Description: VanIcon
 * Copyright (c) 2023 by ZephyrGao, All Rights Reserved. 
 */

import 'package:cn_flutter_ui/src/components/vant4/van_badge.dart';
import 'package:cn_flutter_ui/src/constants/vant4_icon_constant.dart';
import 'package:flutter/material.dart';

class VanIcon extends StatefulWidget {
  const VanIcon(
    this.icon, {
    super.key,
    this.color = Vant4IconConstant.textColor,
    this.size = Vant4IconConstant.size,
    this.badge,
    this.fill,
    this.weight,
    this.grade,
    this.opticalSize,
    this.shadows,
    this.semanticLabel,
    this.textDirection,
  });

  /// material `Icon` `icon` property
  final IconData? icon;

  /// material `Icon` `size` property
  final double? size;

  /// material `Icon` `fill` property
  final double? fill;

  /// material `Icon` `weight` property
  final double? weight;

  /// material `Icon` `grade` property
  final double? grade;

  /// material `Icon` `opticalSize` property
  final double? opticalSize;

  /// material `Icon` `color` property
  final Color? color;

  /// material `Icon` `shadows` property
  final List<Shadow>? shadows;

  /// material `Icon` `semanticLabel` property
  final String? semanticLabel;

  /// material `Icon` `textDirection` property
  final TextDirection? textDirection;

  /// badge on top right TODO
  final VanBadge? badge;

  @override
  State<VanIcon> createState() => _VanIconState();
}

class _VanIconState extends State<VanIcon> with SingleTickerProviderStateMixin {
  @override
  Widget build(BuildContext context) {
    return Icon(widget.icon,
        size: widget.size,
        fill: widget.fill,
        weight: widget.weight,
        grade: widget.grade,
        opticalSize: widget.opticalSize,
        color: widget.color,
        shadows: widget.shadows,
        semanticLabel: widget.semanticLabel,
        textDirection: widget.textDirection);
  }
}
